import requset from '@/utils/http.js'
const getCategorAPI = ()=>{
    return requset({
        url:'/home/category/head'
    })
}
const getCateProductAPI = (id)=>{
    return requset({
        url:'/category',
        params:{
            id
        }
    })
}

const getSubCategoryAPI = (id)=>{
    return requset({
        url:'/category/sub/filter',
        params:{
            id
        }
    })
}
/**
 * @description: 获取导航数据
 * @data {
 categoryId: 1005000 ,
 page: 1,
 pageSize: 20,
 sortField: 'publishTime' | 'orderNum' | 'evaluateNum'
 }
 * @return {*}
 */
// 获取子分类商品数据
const getSubProductAPI = (data)=>{
    return requset({
        url:'/category/goods/temporary',
        method:'POST',
        data
    })
}
export {
    getCategorAPI,
    getCateProductAPI,
    getSubCategoryAPI,
    getSubProductAPI
}